<h1 mat-dialog-title>Save Chart</h1>

<form [formGroup]="chartForm" (submit)="submit()">
  <div mat-dialog-content>
    <mat-form-field class="form-field" appearance="fill">
      <mat-label>Name</mat-label>
      <input matInput formControlName="name" />
      <mat-error
        *ngIf="
          chartForm.controls.name.touched && chartForm.controls.name.invalid
        "
      >
        <span *ngIf="chartForm.controls.name.errors.required"
          >This field is mandatory.</span
        >
      </mat-error>
    </mat-form-field>
  </div>

  <div mat-dialog-actions class="action-buttons">
    <button mat-raised-button mat-button type="button" (click)="onNoClick()">
      Cancel
    </button>
    <button mat-raised-button mat-button cdkFocusInitial color="primary">
      Ok
    </button>
  </div>
</form>
